feat(validation): add pre-execution validation layer#764
feat(validation): add pre-execution validation layer#764manusa merged 3 commits intocontainers:mainfrom
Conversation
manusa
left a comment
There was a problem hiding this comment.
Thx for putting this together.
I gave it an initial look and added a few comments.
108f733 to
b07324e
Compare
|
made a refactor of how this works, sorry to the reviewers, to make work from the kubernetes pkg instead of the mcp pkg, now more dynamic and flexible. also disabled by default. |
manusa
left a comment
There was a problem hiding this comment.
I think that the decoupling from the mcp layer is going great, thx.
I added some more comments regarding the new approach.
manusa
left a comment
There was a problem hiding this comment.
Sorry for the late review, I wanted to check the changes locally to ensure the tests in pkg/mcp could be reverted to their original state in main (they can).
I added a few more comments for your consideration.
| restMapper := rt.restMapperProvider() | ||
| if restMapper == nil { | ||
| return nil, fmt.Errorf("failed to make request: AccessControlRoundTripper restMapper not initialized") | ||
| return nil, fmt.Errorf("failed to make request: restMapper not initialized") |
There was a problem hiding this comment.
Since this is AccessControlRoundTripper (again), this change shouldn't be necessary, the original error provides better context for debugging.
2c940f4 to
ad19b52
Compare
|
@manusa thanks for the review, I addressed the comments and mostly applied your suggestions to simplify the code. |
30eff21 to
83fbd1f
Compare
Add validation middleware that catches errors before they reach the Kubernetes API. Signed-off-by: Nader Ziada <nziada@redhat.com>
Signed-off-by: Nader Ziada <nziada@redhat.com>
cleanup up unused func and fields Signed-off-by: Nader Ziada <nziada@redhat.com>
83fbd1f to
b140a12
Compare
Add validation middleware that catches errors before they reach the Kubernetes API.
Changes:
Closes #775